var nohm = require('nohm').Nohm;
var config = require('../config');

var User = nohm.model('User', {
  properties: {
    name: {
      type: 'string',
      unique: false,
      index: true,
      validations: [
        ['notEmpty']
      ]
    },
    email: {
      type: 'string',
      unique: false,
      validations: [
        ['notEmpty'],
        ['email']
      ],
      index: true
    },
    password: {
      defaultValue: 'pass',
      type: function (value) {
        return value;
      },
      index: true,
      validations: [
        ['minLength', 0]
      ]
    },
    visits: {
      type: 'integer',
      index: true
    }
  } // end properties
});

module.exports = User;